package cn.iune.erp.inventory;


import java.sql.Date;
import java.sql.SQLException;
import java.util.List;

import com.alibaba.fastjson.JSONObject;

public interface IStorageRecordDetailDao {
	
	public void insert(StorageRecordDetail obj);
	
	public void delete(String fID);
	
	public StorageRecordDetail update(StorageRecordDetail obj);

	public List<StorageRecordDetail> getAll();
	
	public List<StorageRecordDetail> getByMasterID(String fMasterID);
	
	public StorageRecordDetail getByID(String fID);
	
//	public long getCount(String sql, List<Object> params);

//	public List<Object> query(String sql, List<Object> params, Integer offset, Integer limit);

	JSONObject jointZCGL(JSONObject data) throws SQLException;

	//获取维修派工单
	public StorageRecordDetail getWXPGByStep(String workNo,String procedureStep,String billType, String enterpriseNo);
	//获取维修发料清单
	public List<StorageRecordDetail> getWXFLByStep(String workNo,String procedureStep,String billType, String enterpriseNo);

	//获取维修完工单
	public StorageRecordDetail getWXWGByStep(String workNo,String procedureStep,String billType, String enterpriseNo);
	

	public List<StorageRecordDetail> getByMasterID(String fMasterID,String billType);

	public List<StorageRecordDetail> getByMasterIDStepIn(String fMasterID,String billType,String procedureStep);

	public List<StorageRecordDetail> getByMasterIDStepOut(String fMasterID,String billType,String procedureStep);

	/////////////////////////计算存货成本使用////////////////////////////////////////////

	//更新出库成本使用。包含出库单和调拨单，但是需要排除销毁单（非存货仓）
	public List<StorageRecordDetail> getListByItemID(String itemID, Date dateStart, Date dateEnd, String enterpriseNo);

	///////////////////////////////////////////////////////////////////////////////////

	/////////////////////////计算工单成本使用////////////////////////////////////////////
	//登记材料成本（领料单）
	//(3)遍历生产/委外发料退料单
	List<StorageRecordDetail> getCostingLLDList(String workNo, Date dateStart, Date dateEnd, String enterpriseNo);

	//登记委外入库数量和生产入库数量
	//(3)遍历生产入库单数据，提取生产入库数量/报废/损耗数量
	List<StorageRecordDetail> getCostingRKDList(Date dateStart, Date dateEnd, String enterpriseNo);
	//登记加工费用
	//(3)遍历委外入库、转移单数据，提取委外加工费用
	List<StorageRecordDetail> getCostingWWDList(Date dateStart, Date dateEnd, String enterpriseNo);

	//(3)根据工单号遍历生产委外入库单数据，更新入库成本使用
	List<StorageRecordDetail> getCostingRKDListByWorkNo(Date dateStart, Date dateEnd, String workNo,
			String enterpriseNo);

	///////////////////////////////////////////////////////////////////////////////////

	/////////////////////////统计工单工时使用////////////////////////////////////////////
	//获取转移单（统计工单工时使用）
	public List<StorageRecordDetail> getOrderZYDByOrigin(String origin, Date dateStart, Date dateEnd, String enterpriseNo);

	JSONObject jointJCJR(JSONObject data) throws SQLException;

	JSONObject query(JSONObject data) throws SQLException;

	JSONObject querySimple(JSONObject data) throws SQLException;

	StorageRecordDetail getByNo(String recordNo, String serialNo, String enterpriseNo);

	JSONObject jointSimple(JSONObject data) throws SQLException;

	JSONObject create(JSONObject data);

	List<StorageRecordDetail> getList(Date dateStart, Date dateEnd, String enterpriseNo);









	
	///////////////////////////////////////////////////////////////////////////////////

}
